﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace jQuery.Validation.DataAnnotations
{
    public sealed class jQueryDataAnnotationsProvider
    {

        private jQueryDataAnnotationsProvider() {}

        public static void RegisterAdapters()
        {
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(RequiredAttribute), typeof(RequiredValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(MinLengthAttribute), typeof(MinLengthValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(MaxLengthAttribute), typeof(MaxLengthValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(RangeLengthAttribute), typeof(RangeLengthValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(MinAttribute), typeof(MinValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(MaxAttribute), typeof(MaxValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(RangeAttribute), typeof(RangeValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(EmailAttribute), typeof(EmailValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(UrlAttribute), typeof(UrlValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DateAttribute), typeof(DateValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DateIsoAttribute), typeof(DateIsoValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DateDeAttribute), typeof(DateDeValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(NumberAttribute), typeof(NumberValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(NumberDeAttribute), typeof(NumberDeValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DigitsAttribute), typeof(DigitsValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(CreditCardAttribute), typeof(CreditCardValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AcceptAttribute), typeof(AcceptValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(EqualToAttribute), typeof(EqualToValidator));
        }
    }
}
